package com.itheima.jiekou3;

import java.lang.annotation.Inherited;

public class Test {

    public static void main(String[] args) {
        InterImpl1 impl1 = new InterImpl1();
        impl1.sing();
        impl1.dance();
        InterImpl2 impl2 = new InterImpl2();
        impl2.sing();
        impl2.dance();

    }
}
interface Inter{
    void sing();
    //新增功能
    default void dance(){
        System.out.println("dance");
    }
}
class InterImpl1 implements Inter,Inter2{

    @Override
    public void sing() {
        System.out.println("sing1");
    }
    public void dance(){
        System.out.println("爱咋跳咋跳");
    }
}
class InterImpl2 implements Inter{

    @Override
    public void sing() {
        System.out.println("sing2");
    }
}
interface  Inter2{
    default void dance(){
        System.out.println("dance");
    }
}